class ArrayList<T>{
    arr:Array<T>
    index:number = 0
    constructor(){
        this.arr = []
    }
    add(ele: T){
        this.arr[this.index++] = ele
    }
    get(index:number){
        return this.arr[index]
    }
}

let arrList = new ArrayList<string>()
arrList.add("abc")
arrList.add("456")
arrList.get(123)
console.log(arrList.get(0))
console.log(arrList)

let arrList2 = new ArrayList<{username:string,age:number}>()
arrList2.add({username:"刘慧杰",age:34})
export {}